package haxe.util.benchmark;

class BenchmarkRunner
{
	public var benchmarks(getBenchmarks,null):Array<Benchmark>;
	public var results(getResults,null):Array<BenchmarkResult>;
	var r:Array<BenchmarkResult>;
	var b:Array<Benchmark>;
	
	public function new()
	{
		b = new Array<Benchmark>();
		r = new Array<BenchmarkResult>();
	}
	
	public function add( benchmark:Benchmark ):Void
	{
		b.push( benchmark );
	}
	
	public function run():Void
	{
		r = new Array<BenchmarkResult>();
		for ( i in b )
		{
			i.run();
			//r = r.concat( i.results );
		}
	}
	
	private function getResults():Array<BenchmarkResult>
	{
		return r;
	}
	
	private function getBenchmarks():Array<Benchmark>
	{
		return b;
	}
}